//package com.yunxin.server.config;
//
//import com.yunxin.gateway.infra.support.auth.GatewayAuthFilter;
//import com.yunxin.gateway.infra.support.auth.jwt.JsonWebTokenTool;
//import com.yunxin.openapi.receive.common.domain.core.ServiceActionRelationManager;
//import com.yunxin.openapi.receive.common.domain.service.ActionService;
//import com.yunxin.openapi.receive.common.domain.service.AuthService;
//import com.yunxin.openapi.receive.common.infra.support.filter.OpenApiGlobalFilter;
//import lombok.RequiredArgsConstructor;
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author zero°
// * @since 2023-12-13
// */
//@Configuration
//@RequiredArgsConstructor
//public class FilterConfig {
//
//    private final JsonWebTokenTool jsonWebTokenTool;
//
//    private final ServiceActionRelationManager serviceActionRelationManager;
//
//    private final AuthService authService;
//
//    private final ActionService actionService;
//
//    @Bean
//    public FilterRegistrationBean<GatewayAuthFilter> gatewayAuthFilterRegistration() {
//        FilterRegistrationBean<GatewayAuthFilter> registration = new FilterRegistrationBean<>();
//        registration.setFilter(gatewayAuthFilter());
//        registration.setName("GatewayAuthFilter");
//        registration.addUrlPatterns("/gateway/*");
//        registration.setOrder(0);
//        return registration;
//    }
//
//    @Bean
//    public GatewayAuthFilter gatewayAuthFilter() {
//        return new GatewayAuthFilter(jsonWebTokenTool);
//    }
//
//    @Bean
//    public FilterRegistrationBean<OpenApiGlobalFilter> openApiGlobalFilterRegistration() {
//        FilterRegistrationBean<OpenApiGlobalFilter> registration = new FilterRegistrationBean<>();
//        registration.setFilter(openApiGlobalFilter());
//        registration.setName("OpenApiGlobalFilter");
//        registration.addUrlPatterns("/openapi/*");
//        registration.setOrder(0);
//        return registration;
//    }
//
//    @Bean
//    public OpenApiGlobalFilter openApiGlobalFilter() {
//        return new OpenApiGlobalFilter(serviceActionRelationManager, authService, actionService);
//    }
//
//}
